﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="MerchandiseDetail.aspx.vb" Inherits="gojira.MerchandiseDetail" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" DataSourceID="SqlDataSource1" GridLines="None" 
        ShowHeader="False">
        <Columns>
            <asp:TemplateField>
            <ItemTemplate>
            <p><asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Picture") %>' /></p>
                <p>Type of Merchandise: <%# Eval("ItemType")%></p>
                <p>Uploader: <%# Eval("FanName")%></p>
                <p>Description <%# Eval("Description")%> </p>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        SelectCommand="SELECT * FROM [Merchandise] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    Average user&#39;s ratings for this item:<br />
    <br />
        <asp:Rating
        width="200" 
        Height="40" 
        ID="rating_average" 
        runat="server" 
        StarCssClass="ratingStar" 
        WaitingStarCssClass="savedRatingStar" 
        EmptyStarCssClass="emptyRatingStar" 
        filledStarCssClass="filledRatingStar"
        MaxRating="5" ReadOnly="True" 
    >
    </asp:Rating>
    <br />
    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" DataSourceID="SqlDataSource3" GridLines="None" 
        ShowHeader="False">
        <Columns>
            <asp:TemplateField>
            <ItemTemplate>
            <a href='MerchReview.aspx?ID=<%# Eval("ID") %>'>Rate this item</a>
            <br />
            <br />
            <a href='MerchComment.aspx?ID=<%# Eval("ID") %>'>Comment on this item</a>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        SelectCommand="SELECT [ID] FROM [Merchandise] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <br />
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource2" Width="328px">
        <Columns>
            <asp:TemplateField HeaderText="Comments">
            <ItemTemplate>
            <div>
                <h1><%# Eval("FanName")%></h1>
                <h2><%# Eval("Subject")%></h2>
                <p><%# Eval("Comment") %></p>
            </div>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:godzillaFilms %>" 
        ProviderName="<%$ ConnectionStrings:godzillaFilms.ProviderName %>" 
        
        SelectCommand="SELECT [FanName], [Subject], [Comment], [ItemID] FROM [MerchandiseComment] WHERE ([ItemID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ItemID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
